throw out the baby with the bathwater

Translations
jeter le bébé avec l'eau du bain
Definitions
To accidentally get rid of something valuable or essential while trying to eliminate something unwanted or unnecessary.